using SM;
using SM.core;
using SS;
using System;
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;
namespace TVSGPP.func
{
	public class frmDoctor : Form
	{
		private IContainer components = null;
		private Label label1;
		public TextBox txtDoctorName;
		public TextBox txtDoctorPhone;
		private Label label3;
		public TextBox txtDoctorAddress;
		private Button btnClose;
		public GroupBox groupBox1;
		private Label label2;
		private Button btnSelect;
		private Button btnAdd;
		private Button btnSave;
		private BindingNavigator bindingNavigator1;
		private ToolStripLabel bindingNavigatorCountItem;
		private ToolStripButton bindingNavigatorMoveFirstItem;
		private ToolStripButton bindingNavigatorMovePreviousItem;
		private ToolStripSeparator bindingNavigatorSeparator;
		private ToolStripTextBox bindingNavigatorPositionItem;
		private ToolStripSeparator bindingNavigatorSeparator1;
		private ToolStripButton bindingNavigatorMoveNextItem;
		private ToolStripButton bindingNavigatorMoveLastItem;
		private ToolStripSeparator bindingNavigatorSeparator2;
		private DataGridViewTextBoxColumn C_DoctorID;
		private DataGridViewTextBoxColumn DoctorName;
		private DataGridViewTextBoxColumn DoctorPhone;
		private DataGridViewTextBoxColumn DoctorAddress;
		private DataGridViewTextBoxColumn DoctorCompany;
		private DataGridViewTextBoxColumn Column1;
		private DataGridViewTextBoxColumn Photo;
		public Grid dgvDoctor;
		private Doctor objDoctor = new Doctor();
		private Func objFunc = new Func();
		public string DoctorID = "";
		private bool IsPostBack = false;
		protected override void Dispose(bool disposing)
		{
			if (disposing && this.components != null)
			{
				this.components.Dispose();
			}
			base.Dispose(disposing);
		}
		private void InitializeComponent()
		{
			this.components = new Container();
			ComponentResourceManager componentResourceManager = new ComponentResourceManager(typeof(frmDoctor));
			DataGridViewCellStyle dataGridViewCellStyle = new DataGridViewCellStyle();
			DataGridViewCellStyle dataGridViewCellStyle2 = new DataGridViewCellStyle();
			DataGridViewCellStyle dataGridViewCellStyle3 = new DataGridViewCellStyle();
			DataGridViewCellStyle dataGridViewCellStyle4 = new DataGridViewCellStyle();
			this.label1 = new Label();
			this.txtDoctorName = new TextBox();
			this.groupBox1 = new GroupBox();
			this.txtDoctorPhone = new TextBox();
			this.label3 = new Label();
			this.txtDoctorAddress = new TextBox();
			this.label2 = new Label();
			this.btnClose = new Button();
			this.btnSelect = new Button();
			this.btnAdd = new Button();
			this.btnSave = new Button();
			this.bindingNavigator1 = new BindingNavigator(this.components);
			this.bindingNavigatorCountItem = new ToolStripLabel();
			this.bindingNavigatorMoveFirstItem = new ToolStripButton();
			this.bindingNavigatorMovePreviousItem = new ToolStripButton();
			this.bindingNavigatorSeparator = new ToolStripSeparator();
			this.bindingNavigatorPositionItem = new ToolStripTextBox();
			this.bindingNavigatorSeparator1 = new ToolStripSeparator();
			this.bindingNavigatorMoveNextItem = new ToolStripButton();
			this.bindingNavigatorMoveLastItem = new ToolStripButton();
			this.bindingNavigatorSeparator2 = new ToolStripSeparator();
			this.dgvDoctor = new Grid();
			this.C_DoctorID = new DataGridViewTextBoxColumn();
			this.DoctorName = new DataGridViewTextBoxColumn();
			this.DoctorPhone = new DataGridViewTextBoxColumn();
			this.DoctorAddress = new DataGridViewTextBoxColumn();
			this.DoctorCompany = new DataGridViewTextBoxColumn();
			this.Column1 = new DataGridViewTextBoxColumn();
			this.Photo = new DataGridViewTextBoxColumn();
			this.groupBox1.SuspendLayout();
			((ISupportInitialize)this.bindingNavigator1).BeginInit();
			this.bindingNavigator1.SuspendLayout();
			((ISupportInitialize)this.dgvDoctor).BeginInit();
			base.SuspendLayout();
			this.label1.AutoSize = true;
			this.label1.Font = new Font("Arial", 9.75f, FontStyle.Regular, GraphicsUnit.Point, 0);
			this.label1.Location = new System.Drawing.Point(8, 27);
			this.label1.Name = "label1";
			this.label1.Size = new Size(54, 16);
			this.label1.TabIndex = 0;
			this.label1.Text = "Họ tên :";
			this.txtDoctorName.Anchor = (AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right);
			this.txtDoctorName.BackColor = Color.White;
			this.txtDoctorName.Font = new Font("Arial", 9.75f, FontStyle.Regular, GraphicsUnit.Point, 0);
			this.txtDoctorName.Location = new System.Drawing.Point(66, 24);
			this.txtDoctorName.Name = "txtDoctorName";
			this.txtDoctorName.Size = new Size(194, 22);
			this.txtDoctorName.TabIndex = 0;
			this.txtDoctorName.KeyDown += new KeyEventHandler(this.txtDoctorName_KeyDown);
			this.txtDoctorName.Enter += new EventHandler(this.txtDoctorName_Enter);
			this.groupBox1.Controls.Add(this.txtDoctorPhone);
			this.groupBox1.Controls.Add(this.label3);
			this.groupBox1.Controls.Add(this.txtDoctorAddress);
			this.groupBox1.Controls.Add(this.label2);
			this.groupBox1.Controls.Add(this.txtDoctorName);
			this.groupBox1.Controls.Add(this.label1);
			this.groupBox1.Font = new Font("Arial", 9.75f, FontStyle.Bold, GraphicsUnit.Point, 0);
			this.groupBox1.Location = new System.Drawing.Point(5, 3);
			this.groupBox1.Name = "groupBox1";
			this.groupBox1.Size = new Size(489, 85);
			this.groupBox1.TabIndex = 2;
			this.groupBox1.TabStop = false;
			this.groupBox1.Text = "Bác sỹ kê đơn : 0000";
			this.txtDoctorPhone.Anchor = (AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right);
			this.txtDoctorPhone.BackColor = Color.White;
			this.txtDoctorPhone.Font = new Font("Arial", 9.75f, FontStyle.Regular, GraphicsUnit.Point, 0);
			this.txtDoctorPhone.Location = new System.Drawing.Point(343, 24);
			this.txtDoctorPhone.Name = "txtDoctorPhone";
			this.txtDoctorPhone.Size = new Size(136, 22);
			this.txtDoctorPhone.TabIndex = 1;
			this.txtDoctorPhone.KeyDown += new KeyEventHandler(this.txtDoctorPhone_KeyDown);
			this.label3.AutoSize = true;
			this.label3.Font = new Font("Arial", 9.75f, FontStyle.Regular, GraphicsUnit.Point, 0);
			this.label3.Location = new System.Drawing.Point(6, 55);
			this.label3.Name = "label3";
			this.label3.Size = new Size(56, 16);
			this.label3.TabIndex = 4;
			this.label3.Text = "Địa chỉ :";
			this.txtDoctorAddress.Anchor = (AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right);
			this.txtDoctorAddress.BackColor = Color.White;
			this.txtDoctorAddress.Font = new Font("Arial", 9.75f, FontStyle.Regular, GraphicsUnit.Point, 0);
			this.txtDoctorAddress.Location = new System.Drawing.Point(66, 52);
			this.txtDoctorAddress.Name = "txtDoctorAddress";
			this.txtDoctorAddress.Size = new Size(413, 22);
			this.txtDoctorAddress.TabIndex = 2;
			this.txtDoctorAddress.KeyDown += new KeyEventHandler(this.txtDoctorAddress_KeyDown);
			this.label2.AutoSize = true;
			this.label2.Font = new Font("Arial", 9.75f, FontStyle.Regular, GraphicsUnit.Point, 0);
			this.label2.Location = new System.Drawing.Point(265, 27);
			this.label2.Name = "label2";
			this.label2.Size = new Size(74, 16);
			this.label2.TabIndex = 2;
			this.label2.Text = "Điện thoại :";
			this.btnClose.FlatAppearance.BorderColor = Color.FromArgb(255, 128, 255);
			this.btnClose.FlatStyle = FlatStyle.Flat;
			this.btnClose.Font = new Font("Arial", 9f, FontStyle.Bold, GraphicsUnit.Point, 163);
			this.btnClose.Location = new System.Drawing.Point(403, 360);
			this.btnClose.Name = "btnClose";
			this.btnClose.Size = new Size(91, 26);
			this.btnClose.TabIndex = 7;
			this.btnClose.Text = "Thoát [ ESC ]";
			this.btnClose.UseVisualStyleBackColor = true;
			this.btnClose.Click += new EventHandler(this.btnClose_Click);
			this.btnSelect.FlatAppearance.BorderColor = Color.FromArgb(255, 128, 255);
			this.btnSelect.FlatStyle = FlatStyle.Flat;
			this.btnSelect.Font = new Font("Arial", 9f, FontStyle.Bold, GraphicsUnit.Point, 163);
			this.btnSelect.Location = new System.Drawing.Point(6, 360);
			this.btnSelect.Name = "btnSelect";
			this.btnSelect.Size = new Size(82, 26);
			this.btnSelect.TabIndex = 4;
			this.btnSelect.Text = "Lựa chọn ";
			this.btnSelect.UseVisualStyleBackColor = true;
			this.btnSelect.Click += new EventHandler(this.btnSelect_Click);
			this.btnAdd.FlatAppearance.BorderColor = Color.FromArgb(255, 128, 255);
			this.btnAdd.FlatStyle = FlatStyle.Flat;
			this.btnAdd.Font = new Font("Arial", 9f, FontStyle.Bold, GraphicsUnit.Point, 163);
			this.btnAdd.Location = new System.Drawing.Point(89, 360);
			this.btnAdd.Name = "btnAdd";
			this.btnAdd.Size = new Size(82, 26);
			this.btnAdd.TabIndex = 5;
			this.btnAdd.Text = "Thêm mới";
			this.btnAdd.UseVisualStyleBackColor = true;
			this.btnAdd.Click += new EventHandler(this.btnAdd_Click);
			this.btnSave.Enabled = false;
			this.btnSave.FlatAppearance.BorderColor = Color.FromArgb(255, 128, 255);
			this.btnSave.FlatStyle = FlatStyle.Flat;
			this.btnSave.Font = new Font("Arial", 9f, FontStyle.Bold, GraphicsUnit.Point, 163);
			this.btnSave.Location = new System.Drawing.Point(172, 360);
			this.btnSave.Name = "btnSave";
			this.btnSave.Size = new Size(82, 26);
			this.btnSave.TabIndex = 6;
			this.btnSave.Text = "Ghi nhận";
			this.btnSave.UseVisualStyleBackColor = true;
			this.btnSave.Click += new EventHandler(this.btnSave_Click);
			this.bindingNavigator1.AddNewItem = null;
			this.bindingNavigator1.AutoSize = false;
			this.bindingNavigator1.BackColor = Color.White;
			this.bindingNavigator1.CountItem = this.bindingNavigatorCountItem;
			this.bindingNavigator1.CountItemFormat = "/ {0}";
			this.bindingNavigator1.DeleteItem = null;
			this.bindingNavigator1.Dock = DockStyle.None;
			this.bindingNavigator1.Font = new Font("Arial", 9f, FontStyle.Regular, GraphicsUnit.Point, 163);
			this.bindingNavigator1.GripStyle = ToolStripGripStyle.Hidden;
			this.bindingNavigator1.Items.AddRange(new ToolStripItem[]
			{
				this.bindingNavigatorMoveFirstItem,
				this.bindingNavigatorMovePreviousItem,
				this.bindingNavigatorSeparator,
				this.bindingNavigatorPositionItem,
				this.bindingNavigatorCountItem,
				this.bindingNavigatorSeparator1,
				this.bindingNavigatorMoveNextItem,
				this.bindingNavigatorMoveLastItem,
				this.bindingNavigatorSeparator2
			});
			this.bindingNavigator1.Location = new System.Drawing.Point(5, 329);
			this.bindingNavigator1.MoveFirstItem = this.bindingNavigatorMoveFirstItem;
			this.bindingNavigator1.MoveLastItem = this.bindingNavigatorMoveLastItem;
			this.bindingNavigator1.MoveNextItem = this.bindingNavigatorMoveNextItem;
			this.bindingNavigator1.MovePreviousItem = this.bindingNavigatorMovePreviousItem;
			this.bindingNavigator1.Name = "bindingNavigator1";
			this.bindingNavigator1.PositionItem = this.bindingNavigatorPositionItem;
			this.bindingNavigator1.RenderMode = ToolStripRenderMode.Professional;
			this.bindingNavigator1.Size = new Size(489, 25);
			this.bindingNavigator1.TabIndex = 143;
			this.bindingNavigator1.Text = "bindingNavigator1";
			this.bindingNavigatorCountItem.Name = "bindingNavigatorCountItem";
			this.bindingNavigatorCountItem.Size = new Size(28, 22);
			this.bindingNavigatorCountItem.Text = "/ {0}";
			this.bindingNavigatorCountItem.ToolTipText = "Total number of items";
			this.bindingNavigatorMoveFirstItem.DisplayStyle = ToolStripItemDisplayStyle.Image;
//			//this.bindingNavigatorMoveFirstItem.Image = (Image)componentResourceManager.GetObject("bindingNavigatorMoveFirstItem.Image");
			this.bindingNavigatorMoveFirstItem.Name = "bindingNavigatorMoveFirstItem";
			this.bindingNavigatorMoveFirstItem.RightToLeftAutoMirrorImage = true;
			this.bindingNavigatorMoveFirstItem.Size = new Size(23, 22);
			this.bindingNavigatorMoveFirstItem.Text = "Move first";
			this.bindingNavigatorMovePreviousItem.DisplayStyle = ToolStripItemDisplayStyle.Image;
            ////this.bindingNavigatorMovePreviousItem.Image = (Image)componentResourceManager.GetObject("bindingNavigatorMovePreviousItem.Image");
			this.bindingNavigatorMovePreviousItem.Name = "bindingNavigatorMovePreviousItem";
			this.bindingNavigatorMovePreviousItem.RightToLeftAutoMirrorImage = true;
			this.bindingNavigatorMovePreviousItem.Size = new Size(23, 22);
			this.bindingNavigatorMovePreviousItem.Text = "Move previous";
			this.bindingNavigatorSeparator.Name = "bindingNavigatorSeparator";
			this.bindingNavigatorSeparator.Size = new Size(6, 25);
			this.bindingNavigatorPositionItem.AccessibleName = "Position";
			this.bindingNavigatorPositionItem.AutoSize = false;
			this.bindingNavigatorPositionItem.Name = "bindingNavigatorPositionItem";
			this.bindingNavigatorPositionItem.Size = new Size(50, 23);
			this.bindingNavigatorPositionItem.Text = "0";
			this.bindingNavigatorPositionItem.ToolTipText = "Current position";
			this.bindingNavigatorSeparator1.Name = "bindingNavigatorSeparator1";
			this.bindingNavigatorSeparator1.Size = new Size(6, 25);
			this.bindingNavigatorMoveNextItem.DisplayStyle = ToolStripItemDisplayStyle.Image;
            ////this.bindingNavigatorMoveNextItem.Image = (Image)componentResourceManager.GetObject("bindingNavigatorMoveNextItem.Image");
			this.bindingNavigatorMoveNextItem.Name = "bindingNavigatorMoveNextItem";
			this.bindingNavigatorMoveNextItem.RightToLeftAutoMirrorImage = true;
			this.bindingNavigatorMoveNextItem.Size = new Size(23, 22);
			this.bindingNavigatorMoveNextItem.Text = "Move next";
			this.bindingNavigatorMoveLastItem.DisplayStyle = ToolStripItemDisplayStyle.Image;
            ////this.bindingNavigatorMoveLastItem.Image = (Image)componentResourceManager.GetObject("bindingNavigatorMoveLastItem.Image");
			this.bindingNavigatorMoveLastItem.Name = "bindingNavigatorMoveLastItem";
			this.bindingNavigatorMoveLastItem.RightToLeftAutoMirrorImage = true;
			this.bindingNavigatorMoveLastItem.Size = new Size(23, 22);
			this.bindingNavigatorMoveLastItem.Text = "Move last";
			this.bindingNavigatorSeparator2.Name = "bindingNavigatorSeparator2";
			this.bindingNavigatorSeparator2.Size = new Size(6, 25);
			this.dgvDoctor.AllowUserToAddRows = false;
			this.dgvDoctor.AllowUserToDeleteRows = false;
			this.dgvDoctor.AllowUserToResizeColumns = false;
			this.dgvDoctor.AllowUserToResizeRows = false;
			dataGridViewCellStyle.BackColor = Color.FromArgb(192, 255, 255);
			dataGridViewCellStyle.Font = new Font("Arial", 9.75f, FontStyle.Regular, GraphicsUnit.Point, 0);
			this.dgvDoctor.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle;
			this.dgvDoctor.BackgroundColor = Color.White;
			this.dgvDoctor.BorderStyle = BorderStyle.Fixed3D;
			this.dgvDoctor.CellBorderStyle = DataGridViewCellBorderStyle.Raised;
			this.dgvDoctor.ColumnHeadersBorderStyle = DataGridViewHeaderBorderStyle.Single;
			dataGridViewCellStyle2.BackColor = SystemColors.Control;
			dataGridViewCellStyle2.Font = new Font("Arial", 9f, FontStyle.Regular, GraphicsUnit.Point, 0);
			dataGridViewCellStyle2.ForeColor = SystemColors.WindowText;
			dataGridViewCellStyle2.SelectionBackColor = Color.Aqua;
			dataGridViewCellStyle2.SelectionForeColor = Color.Black;
			this.dgvDoctor.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle2;
			this.dgvDoctor.ColumnHeadersHeight = 26;
			this.dgvDoctor.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.DisableResizing;
			this.dgvDoctor.Columns.AddRange(new DataGridViewColumn[]
			{
				this.C_DoctorID,
				this.DoctorName,
				this.DoctorPhone,
				this.DoctorAddress,
				this.DoctorCompany,
				this.Column1,
				this.Photo
			});
			this.dgvDoctor.Cursor = Cursors.Hand;
			this.dgvDoctor.EnableHeadersVisualStyles = false;
			this.dgvDoctor.Location = new System.Drawing.Point(5, 91);
			this.dgvDoctor.MultiSelect = false;
			this.dgvDoctor.Name = "dgvDoctor";
			this.dgvDoctor.ReadOnly = true;
			dataGridViewCellStyle3.BackColor = SystemColors.Control;
			dataGridViewCellStyle3.Font = new Font("Arial", 9f, FontStyle.Regular, GraphicsUnit.Point, 0);
			dataGridViewCellStyle3.ForeColor = Color.Black;
			dataGridViewCellStyle3.SelectionBackColor = Color.Aqua;
			dataGridViewCellStyle3.SelectionForeColor = Color.Black;
			this.dgvDoctor.RowHeadersDefaultCellStyle = dataGridViewCellStyle3;
			this.dgvDoctor.RowHeadersVisible = false;
			this.dgvDoctor.RowHeadersWidth = 26;
			this.dgvDoctor.RowHeadersWidthSizeMode = DataGridViewRowHeadersWidthSizeMode.DisableResizing;
			dataGridViewCellStyle4.Font = new Font("Arial", 9.75f, FontStyle.Regular, GraphicsUnit.Point, 0);
			this.dgvDoctor.RowsDefaultCellStyle = dataGridViewCellStyle4;
			this.dgvDoctor.RowTemplate.DefaultCellStyle.BackColor = Color.White;
			this.dgvDoctor.RowTemplate.DefaultCellStyle.Font = new Font("Arial", 9.75f, FontStyle.Regular, GraphicsUnit.Point, 0);
			this.dgvDoctor.RowTemplate.DefaultCellStyle.ForeColor = Color.Black;
			this.dgvDoctor.RowTemplate.DefaultCellStyle.SelectionBackColor = Color.Aqua;
			this.dgvDoctor.RowTemplate.DefaultCellStyle.SelectionForeColor = Color.Black;
			this.dgvDoctor.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
			this.dgvDoctor.Size = new Size(489, 236);
			this.dgvDoctor.TabIndex = 144;
			this.dgvDoctor.CellDoubleClick += new DataGridViewCellEventHandler(this.dgvProducts_CellDoubleClick);
			this.dgvDoctor.CellEnter += new DataGridViewCellEventHandler(this.dgvProducts_CellEnter);
			this.dgvDoctor.KeyPress += new KeyPressEventHandler(this.dgvProducts_KeyPress);
			this.C_DoctorID.DataPropertyName = "ID";
			this.C_DoctorID.HeaderText = "Số hiệu";
			this.C_DoctorID.Name = "C_DoctorID";
			this.C_DoctorID.ReadOnly = true;
			this.C_DoctorID.Visible = false;
			this.DoctorName.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
			this.DoctorName.DataPropertyName = "Name";
			this.DoctorName.HeaderText = "Tên gọi";
			this.DoctorName.MinimumWidth = 160;
			this.DoctorName.Name = "DoctorName";
			this.DoctorName.ReadOnly = true;
			this.DoctorName.Width = 160;
			this.DoctorPhone.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
			this.DoctorPhone.DataPropertyName = "Phone";
			this.DoctorPhone.HeaderText = "Điện thoại";
			this.DoctorPhone.Name = "DoctorPhone";
			this.DoctorPhone.ReadOnly = true;
			this.DoctorPhone.Visible = false;
			this.DoctorAddress.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
			this.DoctorAddress.DataPropertyName = "Address";
			this.DoctorAddress.HeaderText = "Địa chỉ";
			this.DoctorAddress.Name = "DoctorAddress";
			this.DoctorAddress.ReadOnly = true;
			this.DoctorCompany.DataPropertyName = "Company";
			this.DoctorCompany.HeaderText = "Công ty";
			this.DoctorCompany.Name = "DoctorCompany";
			this.DoctorCompany.ReadOnly = true;
			this.DoctorCompany.Visible = false;
			this.Column1.DataPropertyName = "Acc";
			this.Column1.HeaderText = "Column7";
			this.Column1.Name = "Column1";
			this.Column1.ReadOnly = true;
			this.Column1.Visible = false;
			this.Photo.DataPropertyName = "Photo";
			this.Photo.HeaderText = "Column8";
			this.Photo.Name = "Photo";
			this.Photo.ReadOnly = true;
			this.Photo.Visible = false;
			base.AutoScaleDimensions = new SizeF(7f, 15f);
			//base.AutoScaleMode = AutoScaleMode.Font;
			this.BackColor = Color.White;
			base.ClientSize = new Size(500, 393);
			base.ControlBox = false;
			base.Controls.Add(this.dgvDoctor);
			base.Controls.Add(this.bindingNavigator1);
			base.Controls.Add(this.btnSave);
			base.Controls.Add(this.btnAdd);
			base.Controls.Add(this.btnSelect);
			base.Controls.Add(this.btnClose);
			base.Controls.Add(this.groupBox1);
			this.Cursor = Cursors.Hand;
			this.Font = new Font("Arial", 9f, FontStyle.Regular, GraphicsUnit.Point, 0);
			//base.FormBorderStyle = FormBorderStyle.FixedToolWindow;
			base.KeyPreview = true;
			this.MaximumSize = new Size(502, 395);
			this.MinimumSize = new Size(502, 395);
			base.Name = "frmDoctor";
			base.ShowInTaskbar = false;
			base.StartPosition = FormStartPosition.Manual;
			base.Load += new EventHandler(this.frmDoctor_Load);
			base.KeyDown += new KeyEventHandler(this.frmDoctor_KeyDown);
			this.groupBox1.ResumeLayout(false);
			this.groupBox1.PerformLayout();
			((ISupportInitialize)this.bindingNavigator1).EndInit();
			this.bindingNavigator1.ResumeLayout(false);
			this.bindingNavigator1.PerformLayout();
			((ISupportInitialize)this.dgvDoctor).EndInit();
			base.ResumeLayout(false);
		}
		public frmDoctor()
		{
			this.InitializeComponent();
		}
		private void btnClose_Click(object sender, EventArgs e)
		{
			this.DoctorID = "";
			this.txtDoctorAddress.Text = "";
			this.txtDoctorName.Text = "";
			this.txtDoctorPhone.Text = "";
			base.Close();
		}
		private void frmDoctor_KeyDown(object sender, KeyEventArgs e)
		{
			if (e.KeyCode == Keys.Escape)
			{
				base.Close();
			}
		}
		private void frmDoctor_Load(object sender, EventArgs e)
		{
			this.objDoctor.loadGridView(this.dgvDoctor, this.bindingNavigator1);
			this.IsPostBack = true;
		}
		private void btnAdd_Click(object sender, EventArgs e)
		{
			this.DoctorID = "-:-";
			this.txtDoctorAddress.Text = "";
			this.txtDoctorPhone.Text = "";
			this.btnSave.Enabled = true;
			this.txtDoctorName.Text = "";
			this.txtDoctorName.Focus();
		}
		private void btnSave_Click(object sender, EventArgs e)
		{
			if (this.txtDoctorName.Text.Trim() == "")
			{
				MessageBox.Show("Bạn chưa nhập đầy đủ thông tin về Bác sỹ", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
			}
			else
			{
				if (this.objDoctor.action(this.DoctorID, this.txtDoctorName.Text, this.txtDoctorAddress.Text, this.txtDoctorPhone.Text, "", "", "") != 0)
				{
					MessageBox.Show("Có lỗi xảy ra trong quá trình cập nhật thông tin", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
				}
				else
				{
					this.objDoctor.loadGridView(this.dgvDoctor, this.bindingNavigator1);
					this.btnSave.Enabled = false;
				}
			}
		}
		private void btnSelect_Click(object sender, EventArgs e)
		{
			base.Close();
		}
		private void txtDoctorName_KeyDown(object sender, KeyEventArgs e)
		{
			if (e.KeyCode == Keys.Return)
			{
				this.txtDoctorName.Focus();
			}
			else
			{
				if (e.KeyCode == Keys.Down)
				{
					this.dgvDoctor.Focus();
				}
			}
		}
		private void txtDoctorPhone_KeyDown(object sender, KeyEventArgs e)
		{
			if (e.KeyCode == Keys.Return)
			{
				this.txtDoctorAddress.Focus();
			}
			else
			{
				if (e.KeyCode == Keys.Down)
				{
					this.dgvDoctor.Focus();
				}
			}
		}
		private void txtDoctorAddress_KeyDown(object sender, KeyEventArgs e)
		{
			if (e.KeyCode == Keys.Return)
			{
				this.dgvDoctor.Focus();
			}
			else
			{
				if (e.KeyCode == Keys.Down)
				{
					this.dgvDoctor.Focus();
				}
			}
		}
		private void dgvProducts_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
		{
			base.Close();
		}
		private void dgvProducts_CellEnter(object sender, DataGridViewCellEventArgs e)
		{
			try
			{
				if (e.RowIndex > -1)
				{
					this.DoctorID = this.dgvDoctor.Rows[e.RowIndex].Cells["C_DoctorID"].Value.ToString();
					this.txtDoctorName.Text = this.dgvDoctor.Rows[e.RowIndex].Cells["DoctorName"].Value.ToString();
					this.txtDoctorAddress.Text = this.dgvDoctor.Rows[e.RowIndex].Cells["DoctorAddress"].Value.ToString();
					this.txtDoctorPhone.Text = this.dgvDoctor.Rows[e.RowIndex].Cells["DoctorPhone"].Value.ToString();
					this.IsPostBack = false;
				}
			}
			catch (Exception ex)
			{
				MessageBox.Show(ex.Message);
			}
		}
		private void dgvProducts_KeyPress(object sender, KeyPressEventArgs e)
		{
			if (e.KeyChar == '\r')
			{
				base.Close();
			}
		}
		private void txtDoctorName_Enter(object sender, EventArgs e)
		{
			this.IsPostBack = true;
		}
	}
}
